<include file="Public/head"/>
<body class="no-skin">
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->


            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">


                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">



                        <!-- PAGE CONTENT BEGINS -->
                        <form id="query" class="form-inline" action="{:U('lists')}" method="get">

                            <div class="row">
                                <label class="inline">时间</label>
                                <input class="form-control dates" id="date" name="date" value="{:I('date',date('Y-m-d'))}"
                                       type="text" data-date-format="dd-mm-yyyy">


                                <label class="inline">客服</label>
                                <select name="username" class="form-control">
                                    <option
                                    <if condition="I('username') eq null">selected</if>
                                    value="">全部</option>
                                    <foreach name="member" item="mb">
                                        <option
                                        <if condition="I('username') eq $mb[user]">selected</if>
                                        value="{$mb.user}" >{$mb.user}</option>
                                    </foreach>
                                </select>


                                <button type="submit" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    查询
                                </button>

                                <button type="button" onclick="todoCommission()" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-globe  icon-on-right bigger-110"></span>
                                    结算
                                </button>

                                <button type="button" onclick="" class="btn btn-purple btn-sm">
                                   总提成 ：{$money}

                                </button>



                            </div>
                        </form>
                        <div class="space-4"></div>
                        <div class="row">
                            <form id="form" method="post" action="{:U('del')}">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <!--<th class="center"><input class="check-all" type="checkbox" value=""></th>-->
                                        <th>ID</th>
                                        <th>客服</th>
                                        <th>订单ID</th>
                                        <th>金额</th>
                                        <th>时间</th>
                                        <!--<th>状态</th>-->
                                        <th class="center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <style>
                                        .grouptd {
                                            position: relative;
                                        }

                                        .group {
                                            display: inline-block;
                                            width: 100%;
                                        }

                                        .groupselect {
                                            position: absolute;
                                            top: 0;
                                            left: 0;
                                            width: 100%;
                                            height: 100%;
                                            border: 0;
                                        }
                                    </style>
                                    <volist name="dataList" id="val">
                                        <tr>

                                            <td> {$val.id}</td>
                                            <td> {$val.username}</td>
                                            <td> {$val.order_id}</td>
                                            <td> {$val.money}</td>
                                            <td> {$val.create_at}</td>
                                            <!--<td> {$val.rowstatus}</td>-->
                                            <td>
                                                <if condition="$user eq 'admin'">
                                                    <a href="{:U('edit',array('id'=>$val[id]))}">修改</a>

                                                </if>
                                            </td>

                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                            </form>
                            <div class="cf">

                            </div>
                            {$page}
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->

</div><!-- /.main-container -->

<include file="Public/footerjs"/>

<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script src="__PUBLIC__/qwadmin/js/function.js"></script>
<script type="text/javascript">
    jQuery(function ($) {
        $('.dates').datepicker({
            format: 'yyyy-mm-dd',
            weekStart: 1,
            autoclose: true,
            todayBtn: 'linked',
            language: 'cn'
        });
    });
</script>

<script>
    function todoCommission() {
        var date =  $('#date').val();
        var url = "{:u('todoCommission')}";
        $.post(url,{date:date} ,function(data) {
           location=location;
        });
    }
</script>
</body>
</html>
